<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/bootstrap/css/bootstrap.css">
    <script src="${pageContext.request.contextPath}/static/js/jquery-3.3.1.min.js"></script>
    <script src="${pageContext.request.contextPath}/static/bootstrap/js/bootstrap.js"></script>

    <style>
        .row {
            margin-bottom: 30px;
            margin-right: 0 !important;
            margin-left: 0 !important;
        }

        .form-group {
            margin-bottom: 30px;
        }

        .submit {
            margin-left: 30px;
        }

        .modal-btns {
            text-align: center;
        }
    </style>
</head>
<body>
<div class="container-fluid">
    <div class="row">
        <div class="navbar-header">
            <ol class="breadcrumb">
                <li><a href="${pageContext.request.contextPath}/user/toMain" class="btn btn-primary btn-sm"
                       role="button"><span class="glyphicon glyphicon-home pull-right" aria-hidden="true"></span>&nbsp;&nbsp;
                    主&nbsp;&nbsp; 页</a></li>
                <li class="active"><a href="${pageContext.request.contextPath}/article/list/1">文章管理</a></li>
                <li><a href="">文章类型管理</a></li>
                <li class="active"><a href="${pageContext.request.contextPath}/article/addUI">文章添加</a></li>
            </ol>
        </div>
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <!-- 右为普通导航条 -->
            <!--<a class="btn btn-default" href="#" role="button" id = "msg">Link</a>-->
            <ul class="nav navbar-nav navbar-right">
                <!--<li><a href="#">当前用户:<span class="badge">小明</span></a></li>-->
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                       aria-expanded="false">当前用户:<span class="badge">${user.getUsername()}</span><span
                            class="caret"></span></a>
                    <ul class="dropdown-menu">
                        <li><a href="#">修改密码</a></li>
                        <li><a href="#">个人详情</a></li>
                    </ul>
                </li>
                <li>
                    <a href="${pageContext.request.contextPath}/user/exit">
                        <span class="glyphicon glyphicon glyphicon-lock" aria-hidden="true"></span>注销
                    </a>
                </li>
            </ul>
        </div>
    </div>
    <div class="row">
        <div class="col-lg-8 col-lg-offset-2">
            <form class="form-horizontal" action="${pageContext.request.contextPath}/article/add" method="post">
                <!-- 文章标题-->
                <div class="form-group">
                    <label for="articleName" class="col-lg-2 control-label">标&nbsp;&nbsp;&nbsp;&nbsp;题
                        &nbsp;<span class="glyphicon glyphicon-star" aria-hidden="true"
                                    style="color: red!important;"></span>
                    </label>
                    <div class="col-lg-10">
                        <input type="text" class="form-control" id="articleName" name="name" placeholder="输入标题">
                        <span id="articleTitleMessage"></span>
                    </div>

                </div>

                <%--                <div class="form-group">--%>
                <%--                    <label for="articleSummary" class="col-lg-2 control-label">简&nbsp;&nbsp;&nbsp;&nbsp;介</label>--%>
                <%--                    <div class="col-lg-10">--%>
                <%--                        <input type="text" class="form-control" id="articleSummary" name="articleSummary"--%>
                <%--                               placeholder="输入简介">--%>
                <%--                    </div>--%>
                <%--                </div>--%>

                <!-- 演示初始化下拉列表的功能 -->
                <div class="form-group">
                    <label for="articleType" class="col-lg-2 control-label">文章类型</label>
                    <div class="col-lg-10">
                        <select class="form-control" name="articleType.id" id="articleType">
                            <c:forEach items="${typeList}" var="type">
                                <option value="${type.id}">${type.name}</option>
                            </c:forEach>

                            <%--
                            <option value="ca4331e2-fad7-4a05-a094-d8d0c5e445ea">行业新闻</option>
                            <option value="ererer">大事件</option>
                            <option value="yuess">行业介绍</option>--%>
                        </select>
                    </div>
                </div>

                <!-- 演示图片上传功能 -->
                <%--                <div class="form-group">--%>
                <%--                    <label class="control-label col-lg-2" for="file">图&nbsp;&nbsp;&nbsp;&nbsp;片</label>--%>
                <%--                    <div class="col-lg-10">--%>
                <%--                        <input type="file" id="file" name="file" multiple>--%>
                <%--                    </div>--%>
                <%--                </div>--%>

                                <div class="form-group">
                                    <label class="control-label col-lg-2" for="content">文章内容
                                        &nbsp;<span class="glyphicon glyphicon-star" aria-hidden="true"
                                                    style="color: red!important;"></span>
                                    </label>
                                    <div class="col-lg-10">
                                        <textarea rows="30" cols="40" name="article_text" id="content" class="form-control"
                                                  style="resize: none"></textarea>
                                        <span id="articleContentMessage"></span>
                                    </div>
                                </div>

                <%--<div class="modal-btns">--%>
                <div class="form-group">
                    <div class="col-lg-3 col-lg-offset-6">
                        <button type="submit" class="btn btn-primary" onclick="alert('添加成功')">添 加</button>
                    </div>
                </div>
                <%--</div>--%>
            </form>
        </div>
    </div>
</div>
</body>
<script type="text/javascript">

</script>
</html>